import { IsNumber, IsObject, IsOptional, IsString } from 'class-validator';

export class SinglePublishReqDto {
  /** topic */
  @IsString({ message: 'topic 格式不正确' })
  topic: string;

  /** payload */
  @IsObject({ message: 'payload格式不正确' })
  payload: Record<string, any>;

  /** 次数 */
  @IsNumber({}, { message: '次数格式不正确' })
  @IsOptional()
  times?: number;
}
